export const dialogVisible = {
    model: {
        prop: 'dialogVisible',
        event: 'visibleChange'
    },
    props: {
        dialogVisible: {
            type: Boolean,
            default: false
        }
    },
    data() {
        return {}
    },
    watch: {},
    methods: {
        handleClose() {
            this.$confirm('您确定关闭吗?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            })
                .then(() => {
                    this.$emit('visibleChange', false)
                    if (this.dialogTag) {
                        this.$parent.dataForm = Object.assign({}, this.$parent.dataFormDefault)
                    }
                })
                .catch(() => {})
        },
        closeDialog() {
            this.$emit('visibleChange', false)
            if (this.dialogTag) {
                this.$parent.dataForm = Object.assign({}, this.$parent.dataFormDefault)
            }
        }
    }
}
